package com.example.demo.innoket.util;

import java.io.InputStream;
import java.util.Properties;

/**
 * 各类资源配置
 *
 */
public final class Resources {


	/************mysql 数据库配置 ************/
	public static String DRIVER = "com.mysql.cj.jdbc.Driver";
	public static String URL = "jdbc:mysql://localhost:3306/finance?characterEncoding=utf-8&rewriteBatchedStatements=true&useSSL=false"; // 数据库访问串
	public static String USERNAME = "root";
	public static String PASSWORD = "310015";

	/************oracle 数据库配置 ************/
/*	public static String DRIVER = "";
	public static String URL = ""; // 数据库访问串
	public static String USERNAME = "";
	public static String PASSWORD = "";*/

	/**作者*/
	public static String AUTHOR = "";

	/************ 模板配置 ************/
	public static String TEMPLATE_PATH = "";

	public static String CONTROLLER_TEMPLATE_INNER = "";
	public static String CONTROLLER_TEMPLATE_ADMIN = "";
	public static String CONTROLLER_TEMPLATE_MEMBER = "";
	public static String ENTITY_TEMPLATE = "";
	public static String SERVICE_TEMPLATE_ADMIN = "";
	public static String REQUESTS_TEMPLATE = "";
	public static String ROUTE_TEMPLATE = "";

	/************
	 * Package 声明,
	 * 如果只声明了BASE_PACKAGE,未声明其它Package
	 * 那么以base_package为基础创建目录/com/**
	 * -entity -model
	 * -dao
	 * -service
	 * --impl
	 * -controller
	 **************/
	public static String BASE_PACKAGE = "";
	
	/************ 生成JAVA文件的根目录，系统根据package声明进行目录创建 **********/

	static {
		Properties prop = new Properties();
		InputStream in = Object.class.getResourceAsStream("/config.properties");
		try {
			prop.load(in);
			DRIVER = prop.getProperty("driver").trim();
			URL = prop.getProperty("url").trim();
			USERNAME = prop.getProperty("username").trim();
			PASSWORD = prop.getProperty("password").trim();

			AUTHOR = prop.getProperty("author").trim();
			TEMPLATE_PATH = prop.getProperty("template_path").trim();
			BASE_PACKAGE = prop.getProperty("base_package").trim();

			ENTITY_TEMPLATE = prop.getProperty("entity_template").trim();
			SERVICE_TEMPLATE_ADMIN = prop.getProperty("service_template_admin").trim();
			CONTROLLER_TEMPLATE_ADMIN = prop.getProperty("controller_template_admin").trim();
			CONTROLLER_TEMPLATE_INNER = prop.getProperty("controller_template_inner").trim();
			CONTROLLER_TEMPLATE_MEMBER = prop.getProperty("controller_template_member").trim();
			REQUESTS_TEMPLATE = prop.getProperty("requests_template").trim();
			ROUTE_TEMPLATE = prop.getProperty("route_template").trim();

		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	/**
	 * 私有构造方法，不需要创建对象
	 */
	private Resources() {
	}

	public static String getClazzNameByTableName(String tableName) {
		return tableName;
	}




	public static void main(String[] args) {

	}
}
